<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>我的订单</title>

	<link rel="stylesheet" href="__PUBLIC__/static/index/css/mui.min.css"  />
	<link rel="stylesheet" href="__PUBLIC__/static/index/css/iconfont.css" />
	<link rel="stylesheet" href="__PUBLIC__/static/index/css/style.css" />
	<link rel="stylesheet" href="__PUBLIC__/static/index/css/mall.css" />	
</head>
<body>
	<header class="mui-bar mui-bar-nav">
	    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" href="JavaScript:history.go(-1)"></a>
	    <h1 class="mui-title">我的订单</h1>
	</header>
	<div class="mui-content">
	    <ul class="myord_nav clearfix">
	    	<li {if $status==0}class="active"{/if}><a href="{:url('member/orders')}">全部</a></li>
	    	<li {if $status==1}class="active"{/if}><a href="{:url('member/orders',['status'=>1])}">待付款</a></li>
	    	<li {if $status==4}class="active"{/if}><a href="{:url('member/orders',['status'=>4])}">待消费</a></li>
	    	<li {if $status==5}class="active"{/if}><a href="{:url('member/orders',['status'=>5])}">待评价</a></li>
	    </ul>
	    {if count($orders)>0}
	    <div class="myord_lsit">
	    	{foreach name="orders" item='o' empty='暂无订单'}
	    	<div class="myord_item clearfix">
	    		<div class="myord_img" onclick="to_orders({$o.id})"><img src="{$o.logo}"></div>
	    		<div class="myord_info">
	    			<div class="myord_nambox">
	    				<span class="myord_nam"><em onclick="to_orders({$o.id})">{$o.agent_name}</em> > </span>
	    				<span class="myord_zt">
	    					{if $o.status==1}<em onclick="to_pay({$o.id})">去付款</em>
	    					{elseif $o.status==4}待确认消费
	    					{elseif $o.status==5}<em onclick="to_comment({$o.id})">去评价</em>
	    					{elseif $o.status==6}已完成
	    					{elseif $o.status==7}已关闭
	    					{/if}</span>
	    			</div>
	    			<div class="myord_time">{$o.add_time}</div>
	    			<div class="myord_spnum">{$o.goods_name}</div>
	    			<div class="myord_pri" style="font-weight: normal;color: red;">¥{$o.pay_price}</div>
	    			<span class="myord_zt">
	    				<em onclick="up_state({$o.id})">删除</em>
	    			</span>
	    		</div>
	    	</div>
	    	{/foreach}
	    </div>
	    {else}
	    {include file="member/none_style" /}
	    {/if}
	</div>
	{include file="member/bottom1" /}
</body>
</html>
{include file="public/footer" /}
<script>
	function to_pay(oid){
		window.location="/index/member/pay_order?oid="+oid;
	}
	function to_comment(oid){
		window.location="/index/member/comment?oid="+oid;
	}
	function to_orders(oid){	
		window.location="/index/member/order_page?oid="+oid;
	}
	function up_state(oid){	
		$.ajax({
				url:"{:url('member/up_state')}",
				data:{
					oid:oid
				},
				type:"post",
				success: function(data) {
					layer.msg(data.msg,{time: 1000},function(){
						window.location.reload();
					});
				}
		})
	}
</script>